import page from './page.art';

class Footer {
    constructor(tableData) {
        this.version = '0.0.1'
        this.$ = tableData.tableConfig.laymodule.jq;
        this.laypage = tableData.tableConfig.laymodule.laypage;
        this.selector = tableData.tableConfig.selector;
    }

    init(data) {
        const _this = this;
        const pageHtml = page(data.data);
        _this.$(_this.selector).find('.etable-footer').html(pageHtml)
    }

    page(data, next) {
        const _this = this;
        _this.laypage({
            cont: _this.$(_this.selector).find('.etable-page'),
            pages: data.data.pages, //总页数
            groups: 5, //连续显示分页数
            skip: false,
            curr: data.data.pageNum,
            jump: function(obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                console.log(obj)
                next(obj, first)
            }
        });
    }

    setSelectNum(num) {
        console.log(num)
    }

    resetClick() {
        console.log('success')
    }
}

export default Footer;